package com.firefly.dao.dto.cms;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Positive;
import javax.validation.constraints.PositiveOrZero;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @description: 链接
 * @author: lzg(萤火科技 ： 854378082 @ qq.com)
 * @date: 2022/12/20
 **/
@Data
@EqualsAndHashCode
public class LinkDto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Positive(groups = {update.class},message = "ID是大于0的整数")
    private Integer id;
    @PositiveOrZero(groups = {create.class,update.class},message = "分类必须填写")
    private Integer linktypeId;
    @NotBlank(groups = {create.class,update.class},message = "名称不能为空")
    @Size(min = 1,max = 255,groups = {create.class,update.class},message = "名称长度不正确")
    private String title;
    @Size(min = 0,max = 255,groups = {create.class,update.class},message = "图片地址长度不正确")
    private String thumb;
    // @URL(groups = {create.class,update.class},message = "链接地址不正确")
    @NotBlank(groups = {create.class,update.class},message = "链接地址不能为空")
    @Size(min = 1,max = 255,groups = {create.class,update.class},message = "链接地址长度不正确")
    private String url;
    @PositiveOrZero(groups = {create.class,update.class},message = "排序值不正确")
    private Integer sort;
    private Integer status;
    public interface create{};
    public interface update{};
}
